import React,{ useState, useEffect }from 'react';
import { get } from "../../../util/request"

function Index() {
  const [isLoading, setLoading] = useState(true);
  const [pokemon, setPokemon] = useState();

  useEffect(() => {
    get("/v1/credentials/getlist").then(response => {
          setPokemon(response.data);
          setLoading(false);
      });
  }, []);

  if (isLoading) {
      return <div className="App">Loading...</div>;
  }

  return (
      <div className="App">
      {/* <h1>{pokemon}</h1> */}
      {/* <img alt={pokemon.name} src={pokemon.sprites.front_default} /> */}
      </div>
  );
}


export default Index;
